package com.vic.kjlink.order.task;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import com.vic.kjlink.order.service.StartService;

/**
 * @author Vic.xu
 * @description: 定时任务
 * @date: 2021/9/14 0014 16:09
 */
@Component
public class OrderTask {

    private static Logger logger = LoggerFactory.getLogger(OrderTask.class);

    @Resource
    private StartService startService;

    /**
     * 修改开始点餐的状态，如果过期的话
     */
    @Scheduled(initialDelay = 1000, fixedDelay = 1000 * 60 * 5)
    public void synchronizationStartStatus() {
        int num = startService.synchronizationStartStatus();
        if (num > 0) {
            logger.info("修改开始点餐的状态，如果过期的话, 数量:[{}]", num);
        }

    }
}
